import api from "@/api";
import { PORT } from "../config/servicePort";


// 获取当日任务统计
export const getTodayTaskSta = (data: any) => api.post(`${PORT}/api/dispatcher/dashboard/jobDaily`, data);

// 获取当日告警信息
export const getTodayAlert = (data: any) => api.post(`${PORT}/api/dispatcher/dashboard/alertStats`, data);

// 获取所有车辆
export const getAllCarList = (data: any) => api.post(`${PORT}/api/dispatcher/dashboard/vehicles`, data);

// 任务、环线、里程、预警单日统计
export const getTodaySummary = (data: any) => api.post(`${PORT}/api/dispatcher/dashboard/todaySummary`, data);

// 按日期获取任务类型统计
export const getTaskByDate = (data: any) => api.post(`${PORT}/api/dispatcher/statistics/sceneJobByDate`, data);

// 按日期获取车辆工作时长统计
export const getCarTaskTime = (data: any) => api.post(`${PORT}/api/dispatcher/statistics/vehWorkHoursByDate`, data);





//******
// **模板相关 */

/* 获取岗位列表*/
export const getTemplateList = (data?: any) => api.post(`/api/dispatcher/report/page`, data);
/* 创建岗位*/
export const createTemplate = (data?: any) => api.post(`/api/dispatcher/report/add`, data);
/* 更新岗位*/
export const updateTemplate = (data?: any) => api.post(`/api/dispatcher/report/edit`, data);
/* 删除岗位*/
export const deleteTemplate = (data?: any) => api.post(`/api/dispatcher/report/delete/${data.id}`);